
var RootUrl = "";

function removePanel() {
    var tab = $('#tabs').tabs('getSelected');
    if (tab) {
        var index = $('#tabs').tabs('getTabIndex', tab);
        $('#tabs').tabs('close', index);
    }
}
 
function setCookie(name, value) {//两个参数，一个是cookie的名子，一个是值
    var Days = 30; //此 cookie 将被保存 30 天
    var exp = new Date();    //new Date("December 31, 9998");
    exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
    document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
}

function getCookie(name) {//取cookies函数        
    var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
    if (arr != null) return unescape(arr[2]); return null;
}

function addPanelAndIcon(id, title, _iconCls, src) {
    var panelHeight = $('#tabs').tabs('getTab', 0).height() - 5;
    $('#tabs').tabs('add', {
        iconCls: _iconCls,
        title: title,
        content: '<iframe scrolling="yes" frameborder="0"  src="' + src + '" style="width:100%;height:' + panelHeight + 'px;"></iframe>',
        closable: true
    });
    tabClose();
}

function addPanel(id, title, src) {
    var panelHeight = $('#tabs').tabs('getTab', 0).height()-5; 
    $('#tabs').tabs('add', {
        iconCls: 'icon-' + id,
        title: title,
        content: '<iframe scrolling="yes" frameborder="0"  src="' + src + '" style="width:100%;height:' + panelHeight + 'px;"></iframe>',
        closable: true
    });
    tabClose();
}
 
function fun_baseGoUrl(url) {
    window.location.href = url;
} 